package com.qf.exception;

public class BusinessException extends RuntimeException{

    //如果有额外信息要添加，在这个地方定义成员变量，如果没有，那可以不用额外处理
    private Integer errorCode;

    public BusinessException(Integer errorCode) {
        super();
        this.errorCode = errorCode;
    }

    public BusinessException(String message,Integer errorCode) {
        super(message);
        this.errorCode = errorCode;
    }

    public BusinessException(String message, Throwable cause,Integer errorCode) {
        super(message, cause);
        this.errorCode = errorCode;
    }

    public BusinessException(Throwable cause,Integer errorCode) {
        super(cause);
        this.errorCode = errorCode;
    }

    protected BusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace,Integer errorCode) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.errorCode = errorCode;
    }

    public Integer getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(Integer errorCode) {
        this.errorCode = errorCode;
    }
}
